package overview;

/**
 * @author oldliu
 * @since 1.0
 */
public class Pig {
    private String name;
    private int age;
    {
        System.out.println("这是一只猪！！！");
        age=1;
    }
    public Pig(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Pig(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Pig{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
